package com.example.springboot.config.amqp.rabbitmq.directRabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/5/14 14:03
 */
@Component
@RabbitListener(queues = "testDirectQueue")
public class DirectRabbitmqFirstConsumer {
    @RabbitHandler
    public void process(Map message) {
        // direct是轮询机制，一个消费者消费一次轮询
        System.out.println("消费者1收到的消息" + message);
    }
}
